package com.mihong.util;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisUtil {

	private static JedisPool jedisPool = null;
	
	static {
		JedisPoolConfig config = new JedisPoolConfig(); 
        config.setMaxIdle(5); 
        config.setTestOnBorrow(false); 
        //获取连接
        jedisPool = new JedisPool(config,"127.0.0.1",6379);
    }
	
	public static Jedis getResource() {
		return jedisPool.getResource();
	}
	
}
